package com.xmy.cultivate.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xmy.cultivate.enums.ReadingStatusEnum;
import com.xmy.cultivate.enums.StatusOrderApplyEnum;
import com.xmy.cultivate.enums.StatusStudentGradeEnum;
import com.xmy.cultivate.respons.StudentCourse;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 学生所在班级与课程（分班表）
 * </p>
 *
 * @author min
 * @since 2022-08-04
 */
@TableName("student_grade")
@Data
public class StudentGrade implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    
    private Long id;

    /**
     * 对应报名订单id
     */
    private Long orderDetailId;

    /**
     * 班级id
     */
    
    private Long gradeId;

    /**
     * 课程id
     */

    private Integer lessonType;

    private Long courseId;

    /**
     * 科目id
     */
    private Long subjectsId;

    private Integer yearClassId;

    private Long classTypeIdNew;

    private Long studentId;

    private BigDecimal schedulingScore;

    /**
     * 添加类型，1手动添加，2自动排班
     */
    private Integer addType;

    /**
     * 创建人id
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createdId;


    //@TableLogic
    private Integer deleted;

    /**
     * created_at
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    /**
     * updated_at
     */
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updatedAt;

    /**
     * deleted_at
     */
    private LocalDateTime deletedAt;

    /**
     * 对应学校id
     */
    
    private Long schoolId;

    /**
     * 结束日期(结班日期)
     */
    private LocalDate endDate;

    /**
     * 总课时
     */
    //private Integer allCourseCount;

    /**
     * 使用课时
     */
    private Integer useCourseCount;

    /**
     * 剩余课时
     */
    //private Integer residueCourseCount;

    private StatusStudentGradeEnum status;

    private ReadingStatusEnum readingStatus;

    /**
     *续班老师id,加这个字段是为了计算转班情况下，续班算哪在个老师身上，如剩余课时大于等于7次课，算在转班后老师身上，如剩余课时小于7次课算在原来老师身上，（备注：逻辑改变此字段作废）
     */
    private Long renewTeacherId;

    /**
     * 年份
     */
    private Integer yearPart;

    /**
     * 季度
     */
    private Integer quarterNum;

    /**
     * 转入课程时的剩余课程
     */
    private Integer surplusCourseNum;

    /**
     * 是否属于应续人数
     */
    private Integer isRenew;

    private Integer schedulingType;

    /**
     * 停课日期
     */
    private LocalDate stopCourseDate;

    /**
     * 课时状态：1正常，0异常
     */
    private Integer courseStatus;


    /**
     * 转出班级
     */
    @TableField(exist = false)
    private Long outGradeId;

    /**
     * 是否预分班
     */
    private Integer isPresort;

    /**
     * 方便数据统计用是否最后一条
     */
    private Integer isLast;

    private String remark;

    /**
     * 转入班级
     */
    @TableField(exist = false)
    private Long inGradeId;

    @TableField(exist = false)
    private String[] studentIdList;

    @TableField(exist = false)
    private Integer leaveCount;

    @TableField(exist = false)
    private Integer buckle_class_house;

    @TableField(exist = false)
    private Integer residueCourseCount;

    @TableField(exist = false)
    private Integer alreadyCount;

    @TableField(exist = false)
    private Integer notAlreadyCount;

    @TableField(exist = false)
    private Integer totalCount;

    @TableField(exist = false)
    private String schoolName;

    @TableField(exist = false)
    private String studentName;

    @TableField(exist = false)
    private String staffName;

    @TableField(exist = false)
    private String teacherId;

    @ApiModelProperty("学习到的课次")
    @TableField(exist = false)
    private Integer taskCourseNum;

    @ApiModelProperty("应通关数")
    @TableField(exist = false)
    private Integer lowestShutnum;

    @ApiModelProperty("应通关-正确题数")
    @TableField(exist = false)
    private Integer rightNum;

    @ApiModelProperty("应通关-修正题数")
    @TableField(exist = false)
    private Integer amendNum;

    @TableField(exist = false)
    private LocalDate schoolDate;

    @ApiModelProperty("数学任务表课次 对应 财务排班表课次")
    @TableField(exist = false)
    private Integer lessonNum;

    @ApiModelProperty("录入状态：0未录入；1已录入")
    @TableField(exist = false)
    private Integer inputStatus;

    /**
     * 转出班级id(记录转校时自动创建班级是否已经创建)
     */
    private Long outId;

    private Integer outUseCourseCount;

    /**
     * 转出校区详情id
     */
    private Long changeSchoolDetailId;

    @ApiModelProperty("课程名称")
    @TableField(exist = false)
    private String courseName;

    @ApiModelProperty("头像")
    @TableField(exist = false)
    private String headImg;

    @TableField(exist = false)
    private String subjectsName;

    @ApiModelProperty("头像")
    @TableField(exist = false)
    private List<StudentCourse> studentCourseList;

    @TableField(exist = false)
    private Integer yetAdjustCount;

    @TableField(exist = false)
    private Integer notAdjustCount;

    @TableField(exist = false)
    private Integer isAdjust;

    @TableField(exist = false)
    private Long schoolPid;

    @TableField(exist = false)
    private Long courseTypeId;

    @TableField(exist = false)
    private List<StudentGrade> childRateList;

    @TableField(exist = false)
    private String teacherName;

    @TableField(exist = false)
    private String teamId;

    @TableField(exist = false)
    private String teamPid;

    @TableField(exist = false)
    private String teamName;

    @TableField(exist = false)
    private String classTypeStr;

    @TableField(exist = false)
    private String courseTypeStr;

    @TableField(exist = false)
    private Long adminId;

    @TableField(exist = false)
    private Integer yearAndQuarter;

    @TableField(exist = false)
    private LocalDate handleDate;

}
